package com.pencilisland.pay.api.repository;

import java.util.List;

import org.springframework.data.repository.CrudRepository;

import com.pencilisland.pay.api.entity.GoodsEntity;

public interface GoodsRepository extends CrudRepository<GoodsEntity, Long> {

	/**
	 * 通过商品编号查找商品
	 * 
	 * @param code
	 * @return
	 */
	GoodsEntity findByCode(String code);

	List<GoodsEntity> findByStatusOrderByUpdateTimeDesc(Integer status);

	List<GoodsEntity> findByStatusOrderByWeightAscUpdateTimeDesc(Integer status);

}
